﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace HongStone.Repository.Migrations
{
    public partial class tran : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
           

            migrationBuilder.CreateTable(
                name: "gonggaos",
                columns: table => new
                {
                    Gid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Gtitle = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Garea = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    StaffId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_gonggaos", x => x.Gid);
                });

            migrationBuilder.CreateTable(
                name: "rizhis",
                columns: table => new
                {
                    Rid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Title = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    Rarea = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_rizhis", x => x.Rid);
                });

            migrationBuilder.CreateTable(
                name: "TrainAndMore",
                columns: table => new
                {
                    TrainMoreId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TrainAndMoreNumber = table.Column<int>(type: "int", nullable: false),
                    StaffId = table.Column<int>(type: "int", nullable: false),
                    DeptId = table.Column<int>(type: "int", nullable: false),
                    EntryFee = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    AirTicket = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Stay = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Rest = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    Total = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    InTotal = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TrainAndMore", x => x.TrainMoreId);
                });

            migrationBuilder.CreateTable(
                name: "TrainAndOne",
                columns: table => new
                {
                    TrainOneId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    TrainAndOneNumber = table.Column<int>(type: "int", nullable: false),
                    Character = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Content = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    EndTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TrainAndOne", x => x.TrainOneId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "gonggaos");

            migrationBuilder.DropTable(
                name: "rizhis");

            migrationBuilder.DropTable(
                name: "TrainAndMore");

            migrationBuilder.DropTable(
                name: "TrainAndOne");

            migrationBuilder.AddColumn<int>(
                name: "DeptTypeId",
                table: "Department",
                type: "int",
                nullable: false,
                defaultValue: 0);
        }
    }
}
